import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "indexPage",
    component: () => import("@/views/profile/index.vue"),
    redirect: "/leader",
    children: [
      {
        path: "student",
        name: "StudentProfile",
        component: () => import("@/views/profile/students/index.vue"),
        redirect: "/study",
        children: [
          {
            path: "/study",
            name: "study",
            component: () => import("@/views/profile/students/components/study.vue"),
          },
          {
            path: "/health",
            name: "health",
            component: () => import("@/views/profile/students/components/health.vue"),
          },
          {
            path: "/life",
            name: "life",
            component: () => import("@/views/profile/students/components/life.vue"),
          },
        ],
      },
      {
        path: "/teacher",
        name: "TeacherProfile",
        component: () => import("@/views/profile/teachers/index.vue"),
        redirect: "/score",
        children: [
          {
            path: "/score",
            name: "score",
            component: () => import("@/views/profile/teachers/components/score.vue"),
          },
          {
            path: "/teach",
            name: "teach",
            component: () => import("@/views/profile/teachers/components/teach.vue"),
          },
          {
            path: "/result",
            name: "result",
            component: () => import("@/views/profile/teachers/components/result.vue"),
          },
        ],
      },
      {
        path: "/classes",
        name: "ClassProfile",
        component: () => import("@/views/profile/classes/index.vue"),
      },
      {
        path: "/grade",
        name: "GradeProfile",
        component: () => import("@/views/profile/grades/index.vue"),
      },
      {
        path: "/leader",
        name: "LeaderProfile",
        component: () => import("@/views/profile/leaders/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
